Skip to content

docs: fix invalid NaN literal in C examples - #14353

Merged
kgryte merged 3 commits into
developfrom
claude/ecstatic-heisenberg-uql1ml
Aug 17, 2026
Merged

docs: fix invalid NaN literal in C examples#14353
kgryte merged 3 commits into
developfrom
claude/ecstatic-heisenberg-uql1ml

Conversation

@Planeshifter

@Planeshifter Planeshifter commented Aug 17, 2026

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • fixes an invalid NaN literal in README C examples, propagating the correction from 1891207 ("docs: fix default value documentation").

Fixes an identical undefined-NaN usage in the C examples of dnanmidrange and dnanmeanwd READMEs, propagating the correction from dnanmin (commit 1891207). NaN is not a defined identifier in C without additional includes/macros; replaces both occurrences with 0.0/0.0, matching the pattern already used elsewhere in each README's full example and in sibling packages.

The PR originally also propagated the "natural logarithm" JSDoc qualifier from 6e22696 across 22 stats/base/dists log-PDF/CDF/PMF factories; per review, that change set was reverted on this branch (net diff no longer touches those files), as the qualifier insertion is to be reverted at its source instead.

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Validation: both sites were verified inside fenced C code blocks by two independent validation passes plus a style pass against sibling dnan* READMEs (dnanmin, dnanmeanpn, dnanmeanors, dnanmean), all of which use 0.0/0.0 in equivalent snippets. Note: open PR #10203 (C implementation for dnanmidrange) rewrites that README and may need a trivial rebase over the one-line fix.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was authored by Claude Code as part of an automated fix-propagation routine: it identified generalizable fixes merged to develop in the last 24 hours, searched for sibling packages with the same defects, and applied the equivalent one-line fixes after multi-pass validation.


@stdlib-js/reviewers

claude added 2 commits August 17, 2026 13:24
Propagates fix from 6e22696 ("chore: clean-up") to sibling
distribution packages whose `factory.js` JSDoc omits "natural" before
"logarithm" when describing log-PDF/log-CDF evaluation. Each affected
package's `main.js` and inner factory docblocks already use "natural
logarithm"; this makes the outer factory descriptions consistent.
Propagates fix from 1891207 ("docs: fix default value documentation")
to sibling packages whose README C usage examples use a bare `NaN`
literal, which is not defined in C in that context. Replaces `NaN`
with `0.0/0.0`, matching each README's own full example and sibling
package READMEs.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Aug 17, 2026
@stdlib-bot

stdlib-bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/ndarray/dnanmeanwd $\\color{green}176/176$
$\\color{green}+0.00\\%$
$\\color{green}7/7$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}176/176$
$\\color{green}+0.00\\%$
stats/base/ndarray/dnanmidrange $\\color{green}176/176$
$\\color{green}+0.00\\%$
$\\color{green}7/7$
$\\color{green}+0.00\\%$
$\\color{green}2/2$
$\\color{green}+0.00\\%$
$\\color{green}176/176$
$\\color{green}+0.00\\%$

The above coverage report was generated for the changes in this PR.

@kgryte
kgryte marked this pull request as ready for review August 17, 2026 22:20
@kgryte
kgryte requested a review from a team August 17, 2026 22:20
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 17, 2026

@kgryte kgryte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the insertion of "natural" was a mistake. Instead of updating the various descriptions in other stats packages, we should revert the change which inspired the changes in this PR.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Aug 17, 2026
This reverts commit eb43ce577760a02f66e29ceabf5e1c3e30de53d2 per
maintainer review: the insertion of "natural" in 6e22696 was itself
a mistake and is to be reverted at the source rather than propagated
to sibling packages.
@Planeshifter Planeshifter changed the title docs: propagate documentation fixes across stats/base packages docs: fix invalid NaN literal in C examples in stats/base/ndarray Aug 17, 2026

Copy link
Copy Markdown
Member Author

Reverted the natural qualifier changes on this branch and retitled the PR; the net diff is now only the two NaN0.0/0.0 C-example fixes in dnanmidrange and dnanmeanwd.

This PR does not revert 6e22696 itself — leaving that to a maintainer, since it also touched frechet package keywords. One data point for that revert: the affected packages' lib/main.js, lib/native.js, and inner factory docblocks currently read "natural logarithm" (as do 200+ other stats/base/dists files), so reverting only the outer factory line in frechet/logpdf re-introduces the intra-package inconsistency. If the intended direction is the shorter "logarithm of the ..." wording, that sweep would need to cover the wider set.


Generated by Claude Code

@kgryte kgryte added Documentation Improvements, additions, or changes to documentation. and removed Needs Changes Pull request which needs changes before being merged. labels Aug 17, 2026
@kgryte kgryte changed the title docs: fix invalid NaN literal in C examples in stats/base/ndarray docs: fix invalid NaN literal in C examples Aug 17, 2026
@kgryte
kgryte merged commit 86186d0 into develop Aug 17, 2026
33 checks passed
@kgryte
kgryte deleted the claude/ecstatic-heisenberg-uql1ml branch August 17, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements, additions, or changes to documentation. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants